package cn.lr.demo;

import java.math.BigDecimal;

import org.junit.Test;

public class MyTest {
	@Test
	public void test(){
		Double a = 1000.00;
		Double b= 1723.20;
		Double c = 2723.00;
		MyTest t = new MyTest();
		
		System.err.println(t.sub(t.add(a+"", b+""),c+""));
	}
	public  String sub(String arg1, String arg2) {
		if ("".equals(arg1)) {
			arg1 = "0.0";
		}
		if ("".equals(arg2)) {
			arg2 = "0.0";
		}
		BigDecimal big1 = new BigDecimal(arg1);
		BigDecimal big2 = new BigDecimal(arg2);
		BigDecimal big3 = big1.subtract(big2);
		return big3.toString();
	}
	public  String add(String arg1, String arg2) {
		if ("".equals(arg1)) {
			arg1 = "0.0";
		}
		if ("".equals(arg2)) {
			arg2 = "0.0";
		}
		BigDecimal big1 = new BigDecimal(arg1);
		BigDecimal big2 = new BigDecimal(arg2);
		BigDecimal big3 = big1.add(big2);
		return big3.toString();
	}

}
